//获取应用实例
const app = getApp();
import util from '../../../utils/util.js'
import api from '../../../config/api.js'
import WxParse from '../../../wxParse/wxParse.js'

Page({
  data: {},
  onLoad: function (option) {
    let that = this;
    requestData(that, option.url);
  }
})
/**
 * 请求数据
 */
function requestData(that, url) {
  wx.showToast({
    title: '加载中',
    icon: 'loading'
  });
  if (url.indexOf('http') > -1){
    url = url.replace('http', 'https');
  }
  util.request(url).then(function (res) {
    let article = res.body;
    WxParse.wxParse('article', 'html', article, that, 6);
    wx.hideToast();
  });
}

